package day6;

import java.util.Scanner;

public class t1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入机票原价:");
        int money =sc.nextInt();
        System.out.print("请输入购买月份:");
        int mount =sc.nextInt();
        System.out.print("请输入机舱(头等舱 1，经济舱 2):");
        int  site = sc.nextInt();
        if(site != 1 &&site !=2){
            System.out.print("请输入正确的机舱形式。");
            return;
        }
        double sum;
        switch(mount){
            case 5,6,7,8,9,10-> {
                if (site ==1) sum = 0.9 * money;
                else sum= 0.85*money;
                System.out.print("机票价格为："+sum);
            }
            case 1,2,3,4,11,12->{
                if (site ==1) sum = 0.7 * money;
                else sum= 0.65*money;
                System.out.print("机票价格为："+sum);
            }
            default -> {System.out.print("输入月份错误");}
        }
    }
}
